/**
 * Copyright(c) 2010 Ceno Techonologies Co., Ltd.
 *
 * History:
 *   15-7-14 下午4:55 Created by piaohh
 */
package com.jade.bss.beacon.apply.impl;

import java.util.List;
import javax.ejb.TransactionAttribute;
import javax.inject.Inject;
import javax.inject.Named;

import com.jade.bss.beacon.apply.Apply;
import com.jade.bss.beacon.apply.ApplyDao;
import com.jade.bss.beacon.apply.ApplyManager;
import com.jade.framework.base.criterion.Criteria;
import com.jade.framework.base.util.PagingList;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author <a href="mailto:Administrator@ceno.cn">piaohh</a>
 * @version 1.0 15-7-14 下午4:55
 */
@Named ("bss_applyManager")
public class ApplyManagerImpl implements ApplyManager
{
    private ApplyDao applyDao;

    @Inject
    public void setApplyDao(@Named ("bss_applyDao") ApplyDao applyDao)
    {
        this.applyDao = applyDao;
    }

    public Apply get(long id)
    {
        return applyDao.get(id);
    }

    @TransactionAttribute
    @Transactional (rollbackFor = Throwable.class)
    public void add(Apply apply)
    {
        applyDao.add(apply);
    }

    public PagingList<Apply> query(Criteria criteria)
    {
        return applyDao.query(criteria);
    }

    @TransactionAttribute
    @Transactional (rollbackFor = Throwable.class)
    public void update(long applyId, int status,String comment)
    {
        applyDao.update(applyId,status,comment);
    }

    public List<Apply> list(Criteria criteria)
    {
        return applyDao.list(criteria);
    }
}
